
//此处自动引入API外部拆分文件
const install = (Vue, vm) => {
	const modulesFiles = require.context('./api', true, /\.js$/)
	const modules = modulesFiles.keys().reduce((modules, modulePath) => {
	  const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1')
	  const value = modulesFiles(modulePath)
	  modules[moduleName] = value.default
	  return modules
	}, {})
	let obj = {};
	for(let val in modules){
		obj = {...obj,...modules[val]};
	}
	vm.$u.api = obj
}
export default {
	install
}